#pragma once
#include <iostream>
#include <algorithm>
#include <cmath>
#include <vector>
#include <list>
#include <set>
#include <utility>
#include <sstream>

#include <cv.h>
#include <cxcore.h>
#include <highgui.h>

#include "Tools.h"

using namespace std;
namespace Tools
{
	class LinkedList
	{
	public:
		LinkedList(void);
		~LinkedList(void);

		int getLength();
		void insert(CvPoint element, int freeman_code);
		bool getSegment(int startIndex, int endIndex, vector<NodeList*> &result);
		NodeList* get(int index);
		NodeList* get(CvPoint point);
		vector<NodeList*> forward(NodeList* start_point, int step);
		vector<NodeList*> backward(NodeList* start_point, int step);

	private:
		NodeList *head;
		NodeList *tail;
		int length;
	};

}